#!/usr/bin/python3

import subprocess as sub


def cpu():
    p = sub.Popen(['uptime'], stdout=sub.PIPE)
    stdout = p.stdout.read().decode()
    p.wait()
    m1, m5, m15 = stdout.replace(',', '').split()[-3:]
    return '1 minute: %s\n5 minutes: %s\n15 minutes: %s\n' % (m1, m5, m15)


if __name__ == '__main__':
    text = cpu()
    print('Content-Type: text/plain\n\n', end='')
    print(text)
